<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%@page import="com.gm.bamboo.util.CommonUtils"%>
<%@page import="com.gm.bamboo.contant.Global"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<%@ include file="/common/meta.jsp" %>
	<title>中国竹木工艺网(www.bamboo-crafts.cn)-设置会用中心权限</title>
	<meta content="user" name="activemenu" />
	<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet"/>
	<link href="${ctx}/css/master.css" type="text/css" rel="stylesheet"/>
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<script src="${ctx}/js/jcommon.js" type="text/javascript"></script>
	<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
	<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
	<script src="${ctx}/js/DatePicker/WdatePicker.js" type="text/javascript" ></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#startdate").focus();
		$("#inputForm").validate({
			rules: {
				startdate: {
					required:true
				},
				enddate: {
					required:true
				}
			},
			messages: {
				startdate: {
					required: "请输入开始时间"
				},
				enddate: {
					required: "请输入截止时间"
				}
			},
	        errorPlacement: function(error, element) {   
		        if (document.getElementById("error_"+element.attr("name")))  {
		            error.appendTo("#error_"+element.attr("name"));  
		        }
		        else       
		            error.insertAfter(element);   
		        }
		}); 
	});
	document.onkeydown = function(e){    
		e = e || window.event;   
		if(e.keyCode === 13){        
		 onSubmit();   
		}
	};
	function onSubmit() {
		 if($("#inputForm").valid()){
			 if(calDate($("#startdate").val(),$("#enddate").val())){
			 	$("#inputForm").submit();
			 }
		}
	}
	 function calDate(a, b) {
		    var arr = a.split("-");
		    var starttime = new Date(arr[0], arr[1], arr[2]);
		    var starttimes = starttime.getTime();

		    var arrs = b.split("-");
		    var lktime = new Date(arrs[0], arrs[1], arrs[2]);
		    var lktimes = lktime.getTime();

		    if (starttimes >= lktimes) {

		        alert('输入错误,开始时间大于截止时间');
		        return false;
		    }
		    else
		        return true;

		}


</script>
</head>
<body>
<div id="fullbg"></div> 
	<!-- end JS遮罩层 --> 
	<!-- 对话框 --> 
	<div id="dialog"> 
		<div id="dialog_content"></div> 
	</div>
	<div id="wrapper"> 
		<%@include file="/common/header.jsp" %>
		<!-- 正文内容 start -->
		<div id="content"> 
		    <!-- 左侧菜单 总shell start -->
		    <%@include file="/common/adminleft.jsp" %>
		    <!-- 左侧菜单 总shell end --> 
		    
			<!-- 右侧内容 start -->
    		<div class="right_shell"> 
				<h2 class="mb10 box_solid_bottom">会员中心权限</h2>
				<div id="message" style="line-height: 35px;">
					<s:actionmessage theme="custom" cssClass="tipbox"/>
				</div>
				<form id="inputForm" name="inputForm" action="userauth!save.action" method="post">
					<input type="hidden" id="id" name="id" value="${id}"/>
					<input type="hidden" id="userid" name="userid" value="${userid}"/>
	    			<ul class="form">
						<li>以下有<b>*</b>的内容为必填项：</li>
						<li>
				  			<label>开始时间<b>*</b></label>
				  			<input id="startdate" name="startdate" class="Wdate"  onclick="WdatePicker();" readonly="readonly" value="<s:date name="startdate" format="yyyy-MM-dd"/>" type="text" maxlength="100" style="width:300px;" />
				  		</li>
				  		<li>
				  			<label>截至时间<b>*</b></label>
				  			<input id="enddate" name="enddate" class="Wdate"  onclick="WdatePicker();" readonly="readonly" value="<s:date name="enddate" format="yyyy-MM-dd"/>"  type="text" maxlength="100" style="width:300px;" />
				  		</li>
					</ul>    
	 				<p class="button_box">
	 					<button class="course_btn_orange" type="button" onclick="onSubmit();">保存</button> &nbsp;
	 					<button class="course_btn_grey" type="button" onclick="location.href='user.action'">取消</button>&nbsp;
	 				</p> 
	 			</form>
 			</div>
    		<!-- 右侧内容 end --> 
			<p class=" del_float"></p>
		</div>
		<!-- 正文内容 end --> 
		<%@include file="/common/footer.jsp" %>
	</div>
</body>
</html>